fix: clean up docker process in DownloadContainerLogs on timeout#12607
fix: clean up docker process in DownloadContainerLogs on timeout#12607wayne0926 wants to merge 1 commit into1Panel-dev:dev-v2from
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
DownloadContainerLogsstarts adocker logschild process but neverkills it when the 3-second read timeout fires. The function returns, the
HTTP response is sent, and the child process is reparented to PID 1.
On servers with many containers or large log files the timeout is easy to
hit, so these orphans accumulate over time.
This patch:
deferthat kills and reaps the child process on every exit pathProcess.Signal()calls that ran beforeStart(), whichwould panic on the nil
Processpointer